class Animal {
  var name;
  var age;

  int _feet; // _ 只对当前文件私有

  Animal(this.name, this.age) {
    _feet = 4;
  }

  int getFeet() {
    return this._feet;
  }

  run() {
    print('${this.name} run with ${this._feet} feet.');
    final human = Human();
    human.walkAnimal();

    this._play();
  }

  // 私有方法
  _play() {
    print('play');
  }
}

class Human {
  var a = Animal('mymy', 10);

  walkAnimal() {
    print('Human walk animal with ${this.a._feet} feet.'); // _feet 本文件里不私有
  }
}
